package com.cndatacom.eweb.service.impl;

import com.cndatacom.eweb.common.PaginationModel;
import com.cndatacom.eweb.dao.IOrganizationDao;
import com.cndatacom.eweb.model.Organization;
import com.cndatacom.eweb.model.UserOrganization;
import com.cndatacom.eweb.service.IOrganizationService;

public class OrganizationService implements IOrganizationService {

	private IOrganizationDao organizationDao;
	
	public Organization addOrUpdateOrganization(Organization organization) {
		return organizationDao.addOrUpdateOrganization(organization);
	}

	public boolean addOrUpdateUserOrganization(UserOrganization userOrganization) {
		return organizationDao.addOrUpdateUserOrganization(userOrganization);
	}

	public boolean deleteOrganization(Organization organization) {
		return organizationDao.deleteOrganization(organization);
	}

	public boolean deleteUserOrganization(UserOrganization userOrganization) {
		return organizationDao.deleteUserOrganization(userOrganization);
	}

	public PaginationModel getAllOrganization(int offset, int pageSize, boolean paging) {
		return organizationDao.getAllOrganization(offset, pageSize, paging);
	}

	public PaginationModel getAllOrganizationUsers(int organizationId, int offset, int pageSize) {
		return organizationDao.getAllOrganizationUsers(organizationId, offset, pageSize);
	}

	public Organization getOrganationById(int id) {
		return organizationDao.getOrganationById(id);
	}

	public UserOrganization getUserOrganizationByUseridAndOrganizationid(int userId, int organizationId) {
		return organizationDao.getUserOrganizationByUseridAndOrganizationid(userId, organizationId);
	}

	public IOrganizationDao getOrganizationDao() {
		return organizationDao;
	}
	public void setOrganizationDao(IOrganizationDao organizationDao) {
		this.organizationDao = organizationDao;
	}

	public PaginationModel getOrganizationByParentId(int parentId, int offset, int pageSize) {
		return organizationDao.getOrganizationByParentId(parentId, offset, pageSize);
	}

}

